﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using BrandonHaynes.Membership.Factors;

namespace BrandonHaynes.Membership
	{
	/// <summary>
	/// Renders a prompt control based on the DataItem applied against it
	/// </summary>
	public class RenderFactor : Control
		{
		public object DataItem { get; set; }

		protected override void OnDataBinding(EventArgs e)
			{
			base.OnDataBinding(e);
			this.Controls.Add(((IAuthenticationFactor)DataItem).PromptControl);
			}
		}
	}
